package com.aztec.ims.service.dao;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import com.aztec.ims.domain.CustomInformation;
import com.aztec.ims.service.response.GenericResponse;

public class TestCustomInfoDao {
	public static void main(String[] args) {

		save();
		get();
	}

	private static void save() {
		CustomInfoDao dao = new CustomInfoDao();
		Map<String,CustomInformation> request = new HashMap<String, CustomInformation>();
		request.put("1", new CustomInformation("age","28"));
		request.put("2", new CustomInformation("job","engineer"));
		request.put("3", new CustomInformation("company","rbs"));
		GenericResponse response = dao.createCustomInfo(request,'V',"6");
		System.out.println("*****Carrier id generated:" + response
				+ "******");

		Map<String,CustomInformation> request1 = new HashMap<String, CustomInformation>();
		request1.put("1", new CustomInformation("age1","28"));
		request1.put("2", new CustomInformation("job1","doctor"));		
		GenericResponse response1= dao.createCustomInfo(request,'C',"6");
		System.out.println("*****Carrier id generated:" + response1
				+ "******");

	}

	private static void get() {
		CustomInfoDao dao = new CustomInfoDao();
		Map map = dao.getCustomInfo('V', "6");
		
		for(Iterator iter = map.values().iterator();iter.hasNext();){
			CustomInformation info = (CustomInformation)iter.next();
			System.out.println("**name: "+info.getName()+"**value: "+info.getValue());
		}
	}

}
